package commands

import org.crsh.cli.Command
import org.crsh.cli.Usage
import org.crsh.command.InvocationContext

/**
 * Groovy语言定制一个命令
 * springboot会自动扫描/commands/或者/crash/commands/下的类
 * 定制的命令为hello
 */
class hello {
    @Usage("say hello")
    //解释该命令的用途
    @Command
    //注解当前是一个CRaSH命令
    def main(InvocationContext context) {
        def bootVersion = context.attributes['spring.boot.version']
        def springVersion = context.attributes['spring.version']
        return "Hello,your spring boot version is:" + bootVersion + ",spring framework version is:" + springVersion;
    }
}
